﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Database;
using Business;
namespace DT5_Anh09110006_Hung09110044_Vu09110157.QuanLy
{
    public partial class ChiTietNhanVien : System.Web.UI.Page
    {
        Business.QuanLyNhanVien qlnhanvien = new Business.QuanLyNhanVien();
        protected void Page_Load(object sender, EventArgs e)
        {          
            if (!IsPostBack)
            {
                if (Session["MaNhanVien"] != null)
                {
                    loaddulieu();
                }
                else
                {
                    Response.Redirect("QuanLyNhanVien.aspx");
                }
            }
        }
        private void loaddulieu()
        {
            String manhanvien = Session["MaNhanVien"].ToString();
            NhanVien nv = qlnhanvien.LayNhanVienTheoMa(manhanvien);
            lblMaNV.Text = nv.MaNV;
            lblHoTenNV.Text = nv.HoTenNV;
            lblNgaySinh.Text= nv.NgaySinh.Value.ToString("MM/dd/yyyy");
            lblDiaChiNV.Text = nv.DiaChi;
            lblGioiTinh.Text= nv.GioiTinh;
            lblChucVu.Text = nv.ChucVu;
            lblLương.Text = nv.Luong.ToString();
            lblDienThoaiNV.Text = nv.DienThoai;
            lblQuanLy.Text= nv.MaNQL;
            lblCMNDNV.Text = nv.CMND;
            lblEmailNV.Text = nv.Email;

        }

        protected void btnQuayLai_Click(object sender, EventArgs e)
        {
            Session["MaNhanVien"] = null;
            Response.Redirect("QuanLyNhanVien.aspx");
        }
    }
}